<template>
  <div>
    <div class="topBar">
      <div class="w1300 right">
        <router-link to="/">
          <svg-icon icon-class="m-home" /> HOME
        </router-link>
      </div>
    </div>
    <div class="header">
      <div class="w1300">
        <router-link class="logo" to="/marketing">
          <img src="../../../assets/imgs/logo.png" alt="">
        </router-link>
        <div class="serach">
          <el-input v-model="keyWord" maxlength="50" size="medium" />
          <el-button>
            <svg-icon icon-class="m-search" />
          </el-button>
        </div>
        <div v-if="!hideCollect" class="favorite" @click="goCollect">
          <svg-icon icon-class="m-collect" />Favorite
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    hideCollect: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      keyWord: ''
    };
  },
  methods: {
    goCollect() {
      this.$router.push('/marketing/collect');
    }
  }
};
</script>
<style lang="scss" scoped>
.w1300 {
  width: 1300px;
  margin: 0 auto;
}
.topBar {
  height: 36px;
  background: #ebebeb;
  font-family: "Segoe UI";
  .right {
    text-align: right;
    line-height: 36px;
    font-size: 20px;
    a {
      margin-left: 30px;
      i {
        color: #e42d03;
      }
      &:hover {
        color: #666;
      }
    }
  }
}
.header {
  background: #fff;
  font-family: "Segoe UI";
  > .w1300 {
    height: 131px;
    display: flex;
    justify-content: center;
    align-items: center;
    .serach {
      display: flex;
      margin: 0 92px;
      .el-input {
        width: 760px;
        ::v-deep input {
          height: 40px;
          border: 1px solid rgba(173, 173, 173, 1);
          border-right: 0;
          border-radius: 4px 0px 0px 4px;
          &:focus {
            border-color: #e42d03;
          }
        }
      }
      .el-button {
        font-size: 24px;
        height: 40px;
        width: 40px;
        background: rgba(228, 45, 3, 1);
        border: none;
        padding: 0;
        color: #fff;
        border-radius: 0 3px 3px 0;
        &:hover {
          background-color: #d22c06;
        }
      }
    }
    .favorite {
      font-size: 20px;
      cursor: pointer;
      svg {
        margin-right: 5px;
        font-size: 24px;
        color: #d22c06;
      }
    }
  }
}
</style>
